package com.example1;

import com.example1.concreteStrategy.FlyWithWings;
import com.example1.concreteStrategy.Quack;

/**
 * @author 周楠
 * @Date 2023/03/13/下午 10:27
 */
public class ContextTest {


    public static void main(String[] args) {
        MallardDuck mallardDuck = new MallardDuck();
        System.out.println("MallardDuck :");
        mallardDuck.setFly(new FlyWithWings());
        mallardDuck.setSound(new Quack());
        mallardDuck.appreance();
        System.out.println();


        RedHeadDuck redHeadDuck = new RedHeadDuck();
        System.out.println("RedHeadDuck :");
        redHeadDuck.setFly(new FlyWithWings());
        redHeadDuck.setSound(new Quack());
        redHeadDuck.appreance();
        System.out.println();


    }
}
